<?php
class Slider extends FormElement {
	
	private $minValue;
	private $maxValue;
	
	public function __construct($elementId, $labelText, $minValue, $maxValue) {
	
		parent::__construct($elementId, $labelText);
		
		$this->minValue = $minValue;
		$this->maxValue = $maxValue;
	}
	
	protected function renderElement() {
	
		$hiddenLabelClass = '';
		if ($this->labelVisibility == Label::$labelHidden) {
			$hiddenLabelClass = 'class="ui-hidden-accessible"';
		}
	
		echo '<label for="', $this->elementId, '" ', $hiddenLabelClass, ' >', $this->labelText, '</label>';
		echo '<input type="range" name="', $this->elementId, '" min="', $this->minValue, '" max="', $this->maxValue, '" ';
		echo $this->formatAttributes(), ' value="', $this->getDefaultValue() ,'" />';
	}
}
?>